package com.nbsaas.boot.product.rest.resource;

import com.nbsaas.boot.product.api.apis.ProductModelSpecValueApi;
import com.nbsaas.boot.product.data.entity.ProductModelSpecValue;
import com.nbsaas.boot.product.api.domain.request.ProductModelSpecValueRequest;
import com.nbsaas.boot.product.api.domain.response.ProductModelSpecValueResponse;
import com.nbsaas.boot.product.api.domain.simple.ProductModelSpecValueSimple;
import com.nbsaas.boot.product.rest.convert.ProductModelSpecValueSimpleConvert;
import com.nbsaas.boot.product.rest.convert.ProductModelSpecValueEntityConvert;
import com.nbsaas.boot.product.rest.convert.ProductModelSpecValueResponseConvert;
import com.nbsaas.boot.product.data.repository.ProductModelSpecValueRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   商品模型规格值-业务接口实现
*/
@Transactional
@Service
public class ProductModelSpecValueResource extends BaseResource<ProductModelSpecValue,ProductModelSpecValueResponse, ProductModelSpecValueSimple, ProductModelSpecValueRequest>  implements ProductModelSpecValueApi {

    @Resource
    private ProductModelSpecValueRepository productModelSpecValueRepository;

    @Override
    public JpaRepositoryImplementation<ProductModelSpecValue, Serializable> getJpaRepository() {
        return productModelSpecValueRepository;
    }

    @Override
    public Function<ProductModelSpecValue, ProductModelSpecValueSimple> getConvertSimple() {
        return new ProductModelSpecValueSimpleConvert();
    }

    @Override
    public Function<ProductModelSpecValueRequest, ProductModelSpecValue> getConvertForm() {
        return new ProductModelSpecValueEntityConvert();
    }

    @Override
    public Function<ProductModelSpecValue, ProductModelSpecValueResponse> getConvertResponse() {
        return new ProductModelSpecValueResponseConvert();
    }




}


